#!/bin/bash
# usage: ./mpicheck_all.sh <num_experiments>

num_experiments=$1
nprocs=$2

mpicheck_one_script="./mpicheck_one.sh"

# Define the list of specifications to check
MPIS=("liveness-mostefa-byz.ta" "liveness-dumbo-byz.ta"  "liveness-abraham-byz.ta"  "safety-dumbo-byz.ta"  "safety-abraham-byz.ta")
TESTS=("liveness-mostefa-byz.ta")
# Loop over each specification
for spec in "${MPIS[@]}"
do
    case "$spec" in
        "liveness-mostefa-byz.ta")
            properties=("cb0" "cb2" "cb4" "secondphase0" "nonblocking")
            ;;
        "liveness-dumbo-byz.ta")
            properties=("cb0" "cb2" "cb4" "cb5" "unaminity0" "nonblocking")
            ;;
        "liveness-abraham-byz.ta")
            properties=("cb0" "cb2" "cb4" "unaminity0" "nonblocking")
            ;;
        "safety-dumbo-byz.ta")
            properties=("nonblocking" "agree0" "valid0")
            ;;
        "safety-abraham-byz.ta")
            properties=("nonblocking" "agree0" "valid0")
            ;;
        *)
            echo "Unknown specification: $spec"
            ;;
    esac

    # Loop over the properties for the current specification
    for prop in "${properties[@]}"
    do
        $mpicheck_one_script "$spec" "$prop" "$num_experiments" "$nprocs"
    done
done
